/**
 * Created by dukes on 2016/3/2.
 */
class GuildLobbyPanel extends eui.Component{
    public constructor(){
        super();
        this.skinName = "skins.scene.GuildLobbySkin";
        // this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAdded, this );
        // this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoved, this);
    }
    // private onSelectedTab(evt:eui.IndexChangeEvent){
    //     SoundMgr.getInstance().playEffect(SoundMgr.BTN);
    //     this.panel_group.removeAllElements();
    //     if( evt.newIndex == 0){
    //         this.scroller.visible = false;
    //         this.panel_group.addChild(GuildInfo.getInstance());
    //     }else if( evt.newIndex == 1){
    //         this.scroller.visible = false;
    //         this.panel_group.addChild(GuildMember.getInstance());
    //     }else if( evt.newIndex == 2){
    //         this.scroller.visible = false;
    //         this.panel_group.addChild(GuildApply.getInstance());
    //         RedPointMgr.getInstance().update(RedPointMgr.GUILD_APPLY,false);
    //     }else if( evt.newIndex == 3){
    //         this.scroller.visible = true;
    //         window["__guildLogs"]();
    //     }
    //     ChatPopPanel.getInstance().hide();
    // }

    // public onGuildLogs(list){
    //     this.message_area.textFlow = GuildMgr.getInstance().parseLogs(list);
    // }

    // public onReturn(evt:egret.TouchEvent){
    //     SceneMgr.getInstance().switchScene(SceneMgr.SCENE_GUILD_LIST);
    // }

    // private onAdded(evt:egret.Event){
    //     this.img_return.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onReturn, this);
    //     this.fuck_tab.addEventListener(eui.IndexChangeEvent.CHANGE, this.onSelectedTab, this);
    // }
    // private onRemoved(evt:egret.Event){
    //     this.img_return.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onReturn, this);
    //     this.fuck_tab.removeEventListener(eui.IndexChangeEvent.CHANGE, this.onSelectedTab, this);
    // }


    // public img_return:eui.Image;
    // public fuck_tab:eui.TabBar;
    // private panel_group:eui.Group;
    // public hint_guild:eui.Image;
    // public scroller:eui.Scroller;
    // public messageGroup:eui.Group;
    // public message_area:eui.Label;
    // public partAdded(name:string, instance:any) {
    //     super.partAdded(name, instance);
    //     if (name == "fuck_tab") {
    //         this.fuck_tab = instance;
    //         this.fuck_tab.itemRenderer = new eui.ClassFactory(GuildTabRender);
    //         this.fuck_tab.dataProvider = new eui.ArrayCollection([0,1,2,3]);
    //     } else if (name == "panel_group") {
    //         this.panel_group = instance;
    //     }else if (name == "img_return") {
    //         this.img_return = instance;
    //     }else if (name == "hint_guild") {
    //         this.hint_guild = instance;
    //         RedPointMgr.getInstance().registerPoint(RedPointMgr.GUILD_APPLY,instance);
    //     }else if (name == "messageGroup") {
    //         this.messageGroup = instance;
    //     }else if (name == "message_area") {
    //         this.message_area = instance;
    //     }else if (name == "scroller") {
    //         this.scroller = instance;
    //     }
    // }
    // public childrenCreated(){
    //     super.childrenCreated();
    //     this.panel_group.addChild(GuildInfo.getInstance());
    // }
    private static _instance:GuildLobbyPanel;
    public static getInstance():GuildLobbyPanel{
        if( GuildLobbyPanel._instance == null)
            GuildLobbyPanel._instance = new GuildLobbyPanel();
        return GuildLobbyPanel._instance;
    }
}